<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>元素节点的删除</title>
    <script type="text/javascript">
        function method01(){
            //获取所要删除的元素节点
            var divElement04=document.getElementById('div04');
            //通过父亲节点删除
            var fatherElement=document.getElementById('father');
            fatherElement.removeChild(divElement04);
        }
    </script>
</head>
<body>
<div id="father">
    <div>我是div01</div>
    <div>我是div02</div>
    <div>我是div03</div>
    <div id="div04">我是div04</div>
    <div>我是div05</div>
    <div>我是div06</div>
</div>
<button onclick="method01()">删除元素节点</button><br>
</body>
</html>